<?
//request 3 toprated
// CONCAT(SUBSTRING(p1_movies.movieDesc,1,20),'...')  <- werkt alleen in mysql omgeving. result geeft alles terug in php
$ratedmovie = mysql_query("SELECT *
FROM p1_movies join p1_ratings
ON p1_movies.movieID = p1_ratings.movieID
ORDER BY p1_ratings.rating DESC
LIMIT 3");
while($data=mysql_fetch_object($ratedmovie)){
	$trimmedDescr = $data->movieDesc;
	$trimmedDescr = substr($trimmedDescr,0,150);
	if($data->rating != NULL)$rating=$data->rating;else $rating="N/A";
echo '<div style="float:left;width:300px;margin-bottom:5px;>"<img src="'.$data->movieImage.'" width="100px" height="140px" style="float:left;width:100px;"/><div style="float:left;width:200px;">&#160;<b>'.$data->movieName.'</b></div><span style="font-size:11px;">'.$trimmedDescr.'...</span><br/><span style="font-size:10px;color:red;"><b>Rating: '.$rating.'</b><br/><a href="'.$data->movieFlv.'">trailer</a></span></div>';
}
?>